abstracted functionality which formats input data to an array