It would look better if the if logic was inverted and it would return the object inside the if, since this is what is trying to do.