finish validation refactor