Refactored configuration into configuration block. Tests pass locally.