refactored complicated helper function to class InputValuesPreparer