Template refactoring, add tags, style polish