refactor data structure