minor fix to protect for empty package
cleanup for private fun definition