Refactoring after @liuggio's feedbacks