next stop and a whole lot of refactoring