Tidy up case statement