Bit of refactoring around validation