Tests: code cleanup