Removed redundant validation in apply_rule function