Restructured everything to be a bit cleaner