some refactoring in web templates