more refactoring, add close_all to pool and sessions