refactored the package lib