Fix and remove legacy code. It was come during to fix confilcts.