move logic into data manager