reapplied some old commits