add Testable trait, eliminate code duplication