NCL-271 - refactoring, fixed tests