reformat code
removed unused code