Working on refactoring