Update code style
Fix NPE in PlayerFactory