Modularize a bit