More code cleanup. Code is mostly functional.