refactor and prep for login
refactor and prep for login