cleaned up some app delegate code