Add testing; refactor decomp