Refactor: inline factory setup