Switch to AppFramework and clean-up some code