clean up stub comments and reformat and rearrange and optimize