Some optimizations on whammy