Moving code from Xp-Dev