renamed init_vars to end_vars and process_targets to end_rules for better clarity