Login fixed + Refactoring