All optimisation code moved into Server.