Moved code around a bit more.