style and restructure code, still trying to figure out the best way to structure code