Refactoring and validation error created