code refractoring for packages