refactor: parser minor refactor and improvements