More refactoring, this time actually tested
More refactoring, this time actually tested

ronen/Halide,ronen/Halide,psuriana/Halide,psuriana/Halide,psuriana/Halide,psuriana/Halide,kgnk/Halide,kgnk/Halide,kgnk/Halide,ronen/Halide,ronen/Halide,kgnk/Halide,psuriana/Halide,kgnk/Halide,ronen/Halide,kgnk/Halide,psuriana/Halide,kgnk/Halide,kgnk/Halide,psuriana/Halide,ronen/Halide,ronen/Halide,ronen/Halide