refactored implementations to better show differences between frameworks (and reuse code).