Unit tests and name resolver refactoring