updated event, controller and template for better extensibility