refactor Dec.java