Regularity of higher order in two-phase free boundary problems