hidding most globals with a namespace
simplify template