cleaned up plugin script