Allow JDK1.5 and removed deprecated methods