Refactoring in to a bit more sensible structure.