Storing objects instead of arrays