re-engineered pkg for extendability and usability