code refactoring, part one