remove inused code and fix build