refactor: move data logic to model