refactored enchant and window click