Run black with Python 2.7 as target version to unify the code styling and make it more linter and style guide compliant
Adding function definitions based on config values makes testing hard. The task function is always there, and we choose to call it depending on config during runtime.