refactored app config code