Improve speed of basic expansions

Ref #134