Split out player code to a separate file