Refactored tests and increased coverage.