Migrated elogin into a struct, should make systems more versatile and easier to test