remove excess code; use java 7