DRYing out buttons

Splitting the buttons up to reuse more code. Making small functions that
do one thing.