Split tests and create logic for Write results to file