minor clean up
Refactor parameter parsing into a separate method