Refactor library code.