Refactoring a new class