fix player ordering, clean up repeated code