Some refactoring to RecordType