more cleanup and splitting