refact the view compiler