moved player checks to improve readability