add improvements from https://github.com/sockethub/sockethub/issues/146#issuecomment-30775887