refactored discovery
refactor in progress;
models with functional tests works