Imported from https://github.com/Maluuba/hra