Refactor button into a component