refactor utility methods in a new class + findbugs fixes