refactored params check