Refactor phone and note code.