Various code cleanup/commenting