some cleanup to python main app