Optimize code of interactive(), osx() and pipeline()

As the result of those functions will not change during the life of the process, we map those functions to constants.