removing log statements and reformat code