cleanup and seperation of Hlp into seperate library