Refactoring/rearranging the code.