refactor multipeercontroller class