Unit tests improvements

Improve the runtime for unit test for 35 seconds to 13 seconds (for me).