dividing processing into multiple steps