Some cleanup work.
Updated version.