divide GameLayer update method into smaller functions