Modularize slightly