ah, i hate instanceof checks, but i'll live with them for now