code refactored of the data resources