[IMP] package management code refacting