Code moved from deprecated files