refactor changes from bebe's review
refactor more changes from bebe's review