Too many checks for specific object types. Needs to be converted to an object oriented solution.