remove some TODOs and clean code