[all] improve server code