General cleanup, and duplication removal.