refactored plugin code to support project-level settings