[optim] go crazy with code inlineing

close #2