server code refactored & IO statistic implemented