Added template logic to make sessions easier to use