cursor tool refactored and test