Remove redundant code.

There is no reason to have a default case.
Return the object at the end of the function not for each case.