// Code snippet 1 $u_id = Hnb_Session::getInstance()->getUserID(); $arr_joinedTribeInfo = array(); if($u_id) { $arr_joinedTribeInfo = Hnb_Model_Tribe::getInstance()->getTribeInfoByJoiner($u_id); $arr_joinedTribeInfo = empty($arr_joinedTribeInfo) ? array() : $arr_joinedTribeInfo; } // After optimizing , code snippet 1 $u_id = Hnb_Session::getInstance()->getUserID(); $arr_joinedTribeInfo = empty($u_id) ? array() : Hnb_Model_Tribe::getInstance()->getTribeInfoByJoiner($u_id);