pluging refactored (not working)