refactored renderBody method to support console application