Refactor for Joomla 3.2