bpm func optimization