refactoring initial work