refactor button and add bookmark function