[MRG] refactoring package structure and adding new utility functions