Refactored factory methods.