Refactored mouse callbacks & window resize