Cleaning and refactoring of Message and Template views