Added loggers and massively simplified a bunch of logic.