update to cleanup internal data structures