remove unused code, bugfix const