Changed more code to dict<> and pool<>