made parser more dry