refactored plcs