some refactoring to enable managing different types of content