Refactored QLS plugin