cleaning code using /u/bjzaba's tips
more code cleaning