Removed a case statement via a little polymorphism