some clean up and commenting