db, comparison, ranges: store ranges and comparison instead only one or other