Revamped app startup code