Changed code to use the config at constructor level instead of method