source code re-organized[#2] for CUDA project