Cleaned up cfr code