Refactoring the code with SBT