some refactoring, making more generic namings