login page betterly done
extract common functions to modules