This code was moved to its own file.