simplify get resource logic
Add documentation