Refactor to change scope of keyword highlighting