(cleanup) tidied up the case statement structure