removing unused code.
some refactoring
improving code coverage and removing pending tests.