further refactor to pull functional code into util.cpp
added first tut test