refer to https://github.com/abdurryy/Trilio