Use a sepstream for parsing the mode parameter
Remove unneeded complexity