[AddressBook] Changed code to reflect the Model-View-Controller pattern