cleanup and merge