Renamed the collapse functions. Cleanup.