Refactor import code so it is easier to use in the Phone project