Some optimizations and the example server