* Change from format object with multiple anonymous function to 1 function with a switch block