refactor
parser cleanup and testing