Some refactoring after cr.