cleaning up legacy code