working login, reorg directives and templates