make the example work again + some cleanup