just some code refactoring, and improvement around mouse cursor