Moving PHP array creation to data functions