major cleanup for merge