refactor to make resource implementations more regular and modular
further refactorings to make resources independent of each other