Lens lib refactoring