InMemoryFormat cleanup

Added validation in the config
Some minor cleanup in the usage of the setting (switching to switch case for the enum)