Improved server. Reduced main