views refact and more login control