Refactored orzolib and modified its API