factored out initial object creation and final purging