reorg templates, add login and reg templates