much inspired by https://github.com/idiot/doge