refactored mouse cursor drawing