some refactoring again