refactor player component (thanks Khang)