moving validation to parser