moved phone encoding login to models