Clean up some code. More cleanups to come.