switch from resource approach