Replaced enum throw with Exception class