removed unneeded scaffold stuff, improved code structure