Factory functions for client code