simplify opencl code and a small performance boost