Thanks for the tip -- that's neater than the factory function