fix build issues and remove useless stuff