Refactor Records controller