cleanup and integrate