First refactor, added findbugs