refactor of package structure