Moving functionality from MainAvtivity to LoginActivity and removing the class