some cleanup and work towards #14