extracted package name calculation
compiler api slightly modularized