Unwrapping callbacks to ease unit testing, adding tests