Code cleanup of SpeeDRF, better condition checking