-- file pack common logic