Factored out configuring of external application context into separate class