Unused variable removed
'Else' is not required in 'when' if Unit is expected
Existing tests updated according to "'Else' is not required in 'when' if Unit is expected"