refactor plcmp