Moving custom class instanciation into button click action and setting up button control.