Tidying up some old code