add more code to decompose server and session