cleaning up a ton of code