refactor (leave only server realization)