refactoring, better get all resources methd