Finish refactoring the Record class and DB component