TODO: add test for storing functionality