I know this breaks abstraction, but this code is awful. Rewrite is on the todo list