Please refactor this for use a data provider