re-factored code and fixed issue after run FindBugs code analysis tool for JAVA.