rewrite unit tests