better script structure