Restructuring the system testing code