further code refactor, added custom string printout