Reorganize, add more tests