Yes, we don't need this Boolean at all. Actually we don't even need a check here by using projectFields = projectFields.map { Fields.merge(_, inFields) } suggested by you.