getRecord is refactored out to record.js