Reordered and sorted out some unused, old code.