Reworked test code