Moves the logic from all different places into single state listener to combine all inputs into a single output.