Refactoring - avoided Java warnings
Small refactoring to avoid warnings