Refactoring some code, working on copy