Improved the helper method that communicates with the C code - compile source only when necessary