refactored set_feature_count method