Extract common code that gets record value