Removing references to JFactory