cleaning up some of the code in scaffold