lib: restructure