refactored phone parse into a function