remake to case statement