Code refactoring and optimization.
Changed imports in tests.