refactory angular resources