Separate out event handler into separate class