Moving some more logic to the parser.