Cleaned up main plugin file