refacted to make scaffolds more modular