Move Settings into lib, use as factory