refactoring to break up init