Refactor template views and controllers inheritance