Added Java-1.6 features and clean code