a bit of refactoring just moving around