refactoring of data manager