Refactor case code into top level 'cases' folder