refactoring #parties and #party(id)