Refactor branch and tag buttons