refactor data and subscriptions