Doing a bit of refactoring.