moved session interface and renamed it, minor code tidy