Starting code refactoring