Refactoring round 2