Code for the book Pro Spring 3