refactor: validate arguments