Move builder definitions out of their outer classes