move session initializer to before hook
Use convenience functions