clash of clans - optimized js