Minor changes, login code separation (from rest)