Refactored parts of the data importer.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>