Refactor ObjectsHelper::containsStringInValueTree function
Const-correctness and formatting