moved Resource class into resources.py & refactored