refactored from review