Refactor and use configResolver