Refactored arguments parsing