indexes added, refactor for java 6