refactored & added server code