More cleanups of code