remove unnecessary code
local versions of vars not needed
tidy up few small bits of parser