Removing reference to JFactory