some more cleanup & documentation