App Delegate code clean up