code refactoring round 1