abstracted getting data logic; let's leave validation as it is for now