restructure the lib