refactoring: custom method to parse parameters