start to refactor validation