Minor refactor for php v5.3, which doens't support immediate dereferencing of array entries