Extracting creation of beans to a separate trait