refactor of the data plugin