Cursors support and final refactor