Refactoring to merge base classes over to Qlib