more furnace work

and tidying up the code a bit