code cleanup for parser