refactor: use each_value method