Updated Button code and refactored workflow