Improve the events import view code