handle only the single resource type on save
few refactorings