Refactored unit tests execution function