Refactor and version compatible

1. Clear unused functions and refactor default constructor
2. Modify diamond type for Java 1.6 compatibility