Use Factory pattern

Use Factory pattern
no changes