Refactor library structure.