Cleaner player input code.