Initial refactor to remove server