cleaning some code; preparing for #211 part 1 and #193