Mostly code cleanup. Abstracting things out, and preventing magic strings