Removing unnecessary usage of IConfiguration