conditional resources
more refactoring
introduce Singleton, Many and One subclass
restructure code