further clean up and comments