Refactor, refactor, refactoring some more.