refactoring DataManager, refactoring exception handling