Slight refactoring, Plugin fix