Changed switch statements to use predefined constants.
fixing merge issue