Created Player class, and migrated some relevant functions there.