First version of Server component.
Various Refactorings