MBug: Code cleanup and unused code removal.