move constants to config file
added flag for disable threading optimization