specification validation refactor