QApp to QCoreApp
some cleanup