rename login to index
refactor for self sufficient mode