updated/refactor resource code -must improve this later