Further cleanup and commenting