Checking of instance object instead of checking class name

Can you remove this ```else {```as well as the closing bracket? As you return the userproxy object in the ```if``` block it is not necessary as the ```throw``` is only reached when the ```if``` is not executed.

Makes it a bit easier to read and removes indentation