improved unit tests for client