deep refactor