remove un-needed code and fix minor bugs