Modified the log statements to make it more generic.