package refactored and some unit test debug statements taken out