Extract server part to separate module (beginning)