refactoring in LibZen