removed obsolete code; tidy up