Improved ActionEvent-handling