refactored tag template a bit further