remove duplication of method print.variable()