applyButton_click and AddButton_Click refactoring