Code Cleanup

convert all types to builtin
code cleanup - add a define for a function with windows name to unix one
for easier working