refactoring unit tests and added others.