please keep in mind of 'reuse code'.
why not sharing the coe for "createButtonAndClick"? Of course it can. Please rethink about it.