cleanup and prep for library