changed definition by metadata
some refactoring