Cleaned up social network functions