refactoring of function info printing
almost there