refactoring phonescontroller