Move parameter parser code into a its own method