Restruct code
Add log out, change main pages