CFY-1295 more cleanup and add test