refactoring (working)