restructure lib