Reduce code redundancy as suggested by @mwiencek, add a test case
Merge pull request #1 from zas/nametags

Reduce code redundancy as suggested by @mwiencek, add a test case