refactor: previews_controller code