refactor. make things more like Devise is doing stuff.