refactored argument check