made minor code changes according to review
refactored so that using is_public consistently