Isolating exception related functions into a separate c-file