Rework STP implementation in controller.