factor out idFromParams method