rearrang package structure, dealing with resource issues.