bpm refactor