Move player logic to separate file