replaced userlist with a partial to reduce repeated code