Refactoring runtime data structures