Change package structure, minor refactoring