More cleanup and duplication removal.