Changed code to use POJOs.