improved procedure parser