Rather than switching on type, could it be better to have a HTTP request parameter for the separator?