parser.c logic clean-up