improve interface, add more tests