Not really related, but this seems like a good function to go in Action_Controller