Refactor data storing