Refactoring: mostly current_app as app and module path stuff.