add stweaks interface for ondemand's sampling rate, some cosmetic changes