Minor refactoring.

Changed string identity checks to string equality checks.
Extracted read configuration function.