some improvements on unit tests