refactor the ResourceHelper class