My Magento knowledge is terrible, but is there a Magento way of doing this? cc @chnorton