Decompose bar's update function