Added mac and win specific versions of cleanup