improvement and update to java 7