Address book

refactored code to use public and private functions