consolitating app context setup for tests