refactored createSeats function