Refactor to use a data controller