only run if `optimize` option is set, fixes #3