big code refactoring, disentangling packages
Merge pull request #2876 from sebv/refactoring

big code refactoring, disentangling packages