This would be handy to have in a core module :)