Update return typehint
Refactored the tests.