Bit of a refactor.