reorganize

Reorganize app start/login structure and check with server if registered
device.