Created factory functions.

Resolves, #151.