Refactored for pkgtools automatic config generation