Move login stuff to hb.login and hb.history