Refactored phone.js