refactoring from CR