[REVIEW] cleaned up a bit the code, flake8 complains disabled broken stuff, name convention for functions