partial refacto - done #MOFO

RTFM