Adds factory pattern