Unused code removal, and clean ups.