Refactored some deprecated code.
Some methods in Joomla are deprecated and will be removed in Joomla 3.0