Class hierarchy refactoring: added Resource class.