initial from https://github.com/stathat/consistent