Implement error handling for invalid arguments
Remove unused warning method