Slightly improved version of code for First Cup of Java EE 7 Tutorial I followed