Adding a few optimizations for XP