base refactor