Cleaning up the app sample code