Refactoring our code