Some basic refactorization. Add outliers detector from Base:build.