refactoring and connecting the servers together