fix findbugs warnings and reformat