Improve unit tests

Add tests for classes rewrite