Move view hook to view file.