Move duplicated code to Resources utility class

[#56447064]
Merge 56447064-code-climate to master

[#56447064]