re-add gate pulsar pulse counting with multiple actions, optimize builder code