Refactor arguments parser into helpers