Replaced switch with abstract enum method.