Factored out login
merged
Merge pull request #152 from cdallas/master

factored login