changed the interface a bit, still needs some care