move periodicRecordViewState logic into controller