Created factory functions, resolves #151.