merge internal code