delegate magic
some refactoring