Updated merger to handle better imports removal