Code logic refactoring/Added button for Settings UI