Codecleanup

Some minor code cleanup and additional comments