More refactoring on libc.