refactoring argument parsing methods