Extract inline templates to views, add layout and css