removing unused code, refactoring
more refactoring