tests code cleanup