finalizes views and events logic