separate validation from parser