Patterned after https://github.com/LuRsT/hr