refactor library layout