Broke up click listener into multiple functions.