Reorganize test code layout