Removed unnecessary switch statement.

Removed unnecessary switch statement. Replaced hard coded code with returnCode.