Moved interopt code to util