refactor previous merge