Refactored converter.java