first attempt at user sessions and more template refactors