refactoring the test/print methods