Refactor record handling with RecordBuilder