remove some code smells
remove some errors