KGSL functions cleanup and improvement