Move some of the view related code from the Module class to the layout view script