refactored pltest