Refactor tests and increasing coverage.