refactored based on feedbacks