We could do this with a nice for comprehension over the credentials, rather than checking for empty and then getting.