Replace use of funny static initialiser and deprecated methods with the builder.