general code cleanup and upgrade to xna 4