Refactor for reverse domain manipulation, RecordAPI and record tests