Unit tests refactoring + typeof operator