validation refactor