add more testing-cases; be able to handle non-string-typed key; coding style tweak