clean stuff up
condensed some stuff, typechecking still works