refactor for some resource mapping