more cleanup
fix minor compilation errors
shrink god class
shrink god class