Updates to make code decoupled from devise.