remove dead code and tidy up
merged