refactor scaffold