Refactored scaffolder.
Much cleaner and readable code.