Converted into java 7 style