Small code factorizations

Issue #1: Implementing Data Api