adopt changes from https://github.com/sguazt/RUBiS