clean some of the legacy code