Hopjs common functions