refactoring openclwrapper