server context refactor