Restructure package code