cleaning up term.lua