remove unused code and variables