make the code jdk6 friendly