split into modules
more cleanup