fix compile & more cleanup