some tidying work
some more implementation deets