Code cleanup.
Creating an internal isFunction function.