Refactor Parser#parse to simplify it