Adding cdf-test. Refactoring.