Cleaned up for plugins