Refactoring stage 2