cleaning up the case statement