Moved button action logic to controller where it belongs