Refactored cursor fixing to a new class