refactor utils class in records.ts