refactor code activity_player