Refactor parameter parsing method