I'd take this out as a function.