Bit of a refactor