Refactor arguments handler