improved unit tests