Updated refactored version of server