Abstracted some functionality for handling arrays from JSON.