This all needs to be cleaned up in a bad way.