split primary/secondary button logic into own method.