Moved code around to different files so the file names make sense.