added EmbeddedResource and better abstraction of Resource