add bag usage, improve perf