refactored
add support for irregular pkgname