Added more deal tests and refactoring.