pep8 and clean up app_manager.models