part two of refactoring