refactor friend/blocklist, dynamically allocate memory