Removed old sql functions