Lots o' refactoring ...