refactored case check to use prototypal inheritance