Address comments and add more tests