extracted some logic to a new data module