[Correcting] Refactoring the code in the package model