Cleanup insertAdjacentHTML implementation