factor out login view, set up entry point for multiple views