Reworked some stuff and did some cleanup