Refactored the tests and return type.