clean up and rework a ton of stuff