add ProfileOptimization and minor changes