Split isexecutable into its own function