#37 reformat code and reduce warnings