OPAL-2270 - moved logic from resource to service