refactor previous fix