extract functionality to set vertex array attributes