refactor guestbook