Outsource and improve twupdate