Refactors in spu.cpp