minor code cleanup #253 #319 #320 #321

minor code cleanup #253 #319 #320 #321