Modularize a bit.